import request from '@/utils/request';

/**
 * 分页查询
 * @param params
 * @returns {*}
 */
export function queryAllByPager(params) {
  return request({
    url: 'rest/api/manager/v1/server/data/pager',
    method: 'get',
    params
  });
}

/**
 * 查询全部
 * @returns {*}
 */
export function queryAll() {
  return request({
    url: 'rest/api/manager/v1/server/data/blurry',
    method: 'get'
  });
}

/**
 * 查询单个对象
 * @param params
 * @returns {*}
 */
export function queryOne(params) {
  return request({
    url: 'rest/api/manager/v1/server/data/one',
    method: 'get',
    params
  });
}

export function saveObject(data) {
  return request({
    url: 'rest/api/manager/v1/server/data/save/entity',
    method: 'post',
    data
  });
}

export function updateObject(data) {
  return request({
    url: 'rest/api/manager/v1/server/data/update/entity',
    method: 'post',
    data
  });
}

/**
 * 删除
 * @param data
 * @returns {*}
 */
export function deleteObject(data) {
  return request({
    url: 'rest/api/manager/v1/server/data/del',
    method: 'post',
    data
  });
}

/**
 * 解析数据
 * @param data
 * @returns {*}
 */
export function analysisObject(data) {
  return request({
    url: 'rest/api/manager/v1/server/data/analysis',
    method: 'post',
    data
  });
}

export function queryAllDataSource() {
  return request({
    url: 'rest/api/manager/v1/server/data/blurry',
    method: 'get'
  });
}
